Skip to content

test: move sparse-operator parity check to autolens_workspace_test#489

Merged
Jammy2211 merged 1 commit intomainfrom
feature/move-sparse-operator-parity
May 1, 2026
Merged

test: move sparse-operator parity check to autolens_workspace_test#489
Jammy2211 merged 1 commit intomainfrom
feature/move-sparse-operator-parity

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

  • Deletes test__simulate_imaging_data_and_fit__complex_fit_compare_mapping_matrix_sparse_operator from test_autolens/imaging/test_simulate_and_fit_imaging.py.
  • The test called masked_dataset.apply_sparse_operator(), which imports jax.numpy inside ImagingSparseOperator. Library CI does not ship JAX (per PyAutoArray/CLAUDE.md — JAX is xp-gated), so this test was breaking PyAutoBuild with ModuleNotFoundError: No module named 'jax'.
  • Parity coverage is preserved: the equivalent script lives in autolens_workspace_test at scripts/jax_assertions/fit_imaging_sparse_operator.py (companion PR linked below). This matches the precedent set when the autoarray-level analogue was previously moved to scripts/jax_assertions/sparse_operators.py (autolens_workspace_test PR Include profile name in output of paramnames file #68).

Companion PR

Test plan

  • Local run with JAX absent semantically (test no longer collected): pytest test_autolens/imaging/test_simulate_and_fit_imaging.py reports 7 passed (was 8).
  • Companion script python scripts/jax_assertions/fit_imaging_sparse_operator.py prints fit_imaging_sparse_operator: all assertions passed.
  • PyAutoBuild CI reaches the formerly-failing test point and passes.

🤖 Generated with Claude Code

The deleted test called masked_dataset.apply_sparse_operator(), which
imports jax.numpy inside ImagingSparseOperator. Library CI does not ship
JAX (and shouldn't — see PyAutoArray/CLAUDE.md), so this test was
breaking PyAutoBuild with ModuleNotFoundError: No module named 'jax'.

The parity check itself is preserved — it now lives at
autolens_workspace_test/scripts/jax_assertions/fit_imaging_sparse_operator.py
alongside the analogous autoarray-level sparse_operators.py that was
relocated for the same reason.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit 709c0b9 into main May 1, 2026
5 checks passed
@Jammy2211 Jammy2211 deleted the feature/move-sparse-operator-parity branch May 1, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant